// 查看图书详情
const cloud = require('wx-server-sdk')
var rq = require('request-promise')


cloud.init()

// 云函数入口函数
exports.main = async(event, context) => {
  const log = cloud.logger()
  var url = 'https://api.douban.com/v2/book/isbn/' + event.isbn + '?apikey=0df993c66c0c636e29ecbb5344252a4a';
  log.error({
    vurl: url
  })
  var res = rq(url).then(html => {
    return html;
  }).catch(err => {
    console.log(err);
  })
  return res
}